Optimal. Leaf size=76 \[ \frac{\left (b^2-2 c (a+c)\right ) \tanh ^{-1}\left (\frac{b+2 c \sin (x)}{\sqrt{b^2-4 a c}}\right )}{c^2 \sqrt{b^2-4 a c}}+\frac{b \log \left (a+b \sin (x)+c \sin ^2(x)\right )}{2 c^2}-\frac{\sin (x)}{c} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.142085, antiderivative size = 76, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 6, integrand size = 19, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.316, Rules used = {3258, 1657, 634, 618, 206, 628} \[ \frac{\left (b^2-2 c (a+c)\right ) \tanh ^{-1}\left (\frac{b+2 c \sin (x)}{\sqrt{b^2-4 a c}}\right )}{c^2 \sqrt{b^2-4 a c}}+\frac{b \log \left (a+b \sin (x)+c \sin ^2(x)\right )}{2 c^2}-\frac{\sin (x)}{c} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3258
Rule 1657
Rule 634
Rule 618
Rule 206
Rule 628
Rubi steps
\begin{align*} \int \frac{\cos ^3(x)}{a+b \sin (x)+c \sin ^2(x)} \, dx &=\operatorname{Subst}\left (\int \frac{1-x^2}{a+b x+c x^2} \, dx,x,\sin (x)\right )\\ &=\operatorname{Subst}\left (\int \left (-\frac{1}{c}+\frac{a+c+b x}{c \left (a+b x+c x^2\right )}\right ) \, dx,x,\sin (x)\right )\\ &=-\frac{\sin (x)}{c}+\frac{\operatorname{Subst}\left (\int \frac{a+c+b x}{a+b x+c x^2} \, dx,x,\sin (x)\right )}{c}\\ &=-\frac{\sin (x)}{c}+\frac{b \operatorname{Subst}\left (\int \frac{b+2 c x}{a+b x+c x^2} \, dx,x,\sin (x)\right )}{2 c^2}-\frac{\left (b^2-2 c (a+c)\right ) \operatorname{Subst}\left (\int \frac{1}{a+b x+c x^2} \, dx,x,\sin (x)\right )}{2 c^2}\\ &=\frac{b \log \left (a+b \sin (x)+c \sin ^2(x)\right )}{2 c^2}-\frac{\sin (x)}{c}+\frac{\left (b^2-2 c (a+c)\right ) \operatorname{Subst}\left (\int \frac{1}{b^2-4 a c-x^2} \, dx,x,b+2 c \sin (x)\right )}{c^2}\\ &=\frac{\left (b^2-2 c (a+c)\right ) \tanh ^{-1}\left (\frac{b+2 c \sin (x)}{\sqrt{b^2-4 a c}}\right )}{c^2 \sqrt{b^2-4 a c}}+\frac{b \log \left (a+b \sin (x)+c \sin ^2(x)\right )}{2 c^2}-\frac{\sin (x)}{c}\\ \end{align*}
Mathematica [A] time = 0.114902, size = 73, normalized size = 0.96 \[ \frac{\frac{2 \left (b^2-2 c (a+c)\right ) \tanh ^{-1}\left (\frac{b+2 c \sin (x)}{\sqrt{b^2-4 a c}}\right )}{\sqrt{b^2-4 a c}}+b \log \left (a+b \sin (x)+c \sin ^2(x)\right )-2 c \sin (x)}{2 c^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.179, size = 143, normalized size = 1.9 \begin{align*} -{\frac{\sin \left ( x \right ) }{c}}+{\frac{b\ln \left ( a+b\sin \left ( x \right ) +c \left ( \sin \left ( x \right ) \right ) ^{2} \right ) }{2\,{c}^{2}}}+2\,{\frac{a}{c\sqrt{4\,ca-{b}^{2}}}\arctan \left ({\frac{b+2\,c\sin \left ( x \right ) }{\sqrt{4\,ca-{b}^{2}}}} \right ) }+2\,{\frac{1}{\sqrt{4\,ca-{b}^{2}}}\arctan \left ({\frac{b+2\,c\sin \left ( x \right ) }{\sqrt{4\,ca-{b}^{2}}}} \right ) }-{\frac{{b}^{2}}{{c}^{2}}\arctan \left ({(b+2\,c\sin \left ( x \right ) ){\frac{1}{\sqrt{4\,ca-{b}^{2}}}}} \right ){\frac{1}{\sqrt{4\,ca-{b}^{2}}}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.91011, size = 670, normalized size = 8.82 \begin{align*} \left [-\frac{{\left (b^{2} - 2 \, a c - 2 \, c^{2}\right )} \sqrt{b^{2} - 4 \, a c} \log \left (-\frac{2 \, c^{2} \cos \left (x\right )^{2} - 2 \, b c \sin \left (x\right ) - b^{2} + 2 \, a c - 2 \, c^{2} + \sqrt{b^{2} - 4 \, a c}{\left (2 \, c \sin \left (x\right ) + b\right )}}{c \cos \left (x\right )^{2} - b \sin \left (x\right ) - a - c}\right ) -{\left (b^{3} - 4 \, a b c\right )} \log \left (-c \cos \left (x\right )^{2} + b \sin \left (x\right ) + a + c\right ) + 2 \,{\left (b^{2} c - 4 \, a c^{2}\right )} \sin \left (x\right )}{2 \,{\left (b^{2} c^{2} - 4 \, a c^{3}\right )}}, \frac{2 \,{\left (b^{2} - 2 \, a c - 2 \, c^{2}\right )} \sqrt{-b^{2} + 4 \, a c} \arctan \left (-\frac{\sqrt{-b^{2} + 4 \, a c}{\left (2 \, c \sin \left (x\right ) + b\right )}}{b^{2} - 4 \, a c}\right ) +{\left (b^{3} - 4 \, a b c\right )} \log \left (-c \cos \left (x\right )^{2} + b \sin \left (x\right ) + a + c\right ) - 2 \,{\left (b^{2} c - 4 \, a c^{2}\right )} \sin \left (x\right )}{2 \,{\left (b^{2} c^{2} - 4 \, a c^{3}\right )}}\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.26818, size = 105, normalized size = 1.38 \begin{align*} \frac{b \log \left (c \sin \left (x\right )^{2} + b \sin \left (x\right ) + a\right )}{2 \, c^{2}} - \frac{\sin \left (x\right )}{c} - \frac{{\left (b^{2} - 2 \, a c - 2 \, c^{2}\right )} \arctan \left (\frac{2 \, c \sin \left (x\right ) + b}{\sqrt{-b^{2} + 4 \, a c}}\right )}{\sqrt{-b^{2} + 4 \, a c} c^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]